import React from "react";
import { Carousel } from 'antd';
import NewsList from "../components/newslist";
import "../../../static/css/mobile/top_lunbo.less";
import Header from "../header";

export default class Hot extends React.Component{

		constructor(){
		super();
		this.state = {
			newsList : []
		}
	}

   componentDidMount(){
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=top&count=4",{
			method:"get"
		})
		.then(res => {
			return res.json();
		})
		.then(json => {
			this.setState({
				newsList:json
			})
		})
		
	}


	render(){
		var { newsList }  = this.state;
		return (
			<div>
			    <Header />
                <Carousel autoplay>
                {
                  newsList.map((a,b)=>{
                  	return (
                       <div>
                          <a href={a.url}>
                             <img style={{width:'100%'}} src={a.thumbnail_pic_s} alt=""/>
				          </a>
                       </div>
                  		)
                  })
				  }
			     </Carousel>
			    < NewsList /> 
			</div>
		)
	}
}

